<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>会员中心 - M3U8播放器</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        /* 添加会员中心专属样式 */
        .member-container {
            max-width: 1200px;
            margin: 20px auto;
            padding: 0 15px;
        }
        
        .member-card {
            background: white;
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            padding: 24px;
        }
        
        .member-header {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .member-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: #f5f5f5;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 20px;
            font-size: 32px;
            color: #666;
        }
        
        .member-info h2 {
            margin: 0;
            font-size: 24px;
        }
        
        .member-info p {
            margin: 5px 0 0;
            color: #666;
        }
        
        .history-section {
            margin-top: 30px;
        }
        
        .history-title {
            font-size: 18px;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }
        
        .history-title i {
            margin-right: 10px;
            color: #1890ff;
        }
        
        .history-list {
            list-style: none;
            padding: 0;
        }
        
        .history-item {
            padding: 12px 0;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            align-items: center;
        }
        
        .history-item:last-child {
            border-bottom: none;
        }
        
        .history-thumb {
            width: 120px;
            height: 80px;
            background: #000;
            margin-right: 15px;
            position: relative;
            overflow: hidden;
        }
        
        .history-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .history-content {
            flex: 1;
        }
        
        .history-title {
            font-size: 16px;
            margin: 0 0 5px;
            color: #333;
        }
        
        .history-meta {
            display: flex;
            font-size: 13px;
            color: #666;
        }
        
        .history-meta span {
            margin-right: 15px;
        }
        
        .history-progress {
            width: 100%;
            height: 4px;
            background: #f0f0f0;
            margin-top: 8px;
            border-radius: 2px;
            overflow: hidden;
        }
        
        .history-progress-bar {
            height: 100%;
            background: #1890ff;
        }
        
        .history-action {
            margin-left: 15px;
        }
        
        .history-action a {
            color: #1890ff;
            text-decoration: none;
        }
        
        .no-history {
            text-align: center;
            padding: 40px 0;
            color: #999;
        }
    </style>
</head>
<body>
    <div class="member-container">
        <div class="member-card">
            <div class="member-header">
                <div class="member-avatar">
                    <i class="fas fa-user"></i>
                </div>
                <div class="member-info">
                    <h2>{$member.username}</h2>
                    <p>注册时间: {$member.created_at|date='Y-m-d'}</p>
                </div>
            </div>
            
            <div class="history-section">
                <h3 class="history-title">
                    <i class="fas fa-history"></i>
                    最近观看
                </h3>
                
                {if !empty($histories)}
                <ul class="history-list">
                    {foreach $histories as $item}
                    <li class="history-item">
                        <div class="history-thumb">
                            <!-- 这里可以添加视频缩略图 -->
                            <div style="display: flex; align-items: center; justify-content: center; height: 100%; color: white;">
                                <i class="fas fa-play" style="font-size: 24px;"></i>
                            </div>
                        </div>
                        <div class="history-content">
                            <h4 class="history-title">{$item.title}</h4>
                            <div class="history-meta">
                                <span><i class="fas fa-clock"></i> {$item.created_at|date='Y-m-d H:i'}</span>
                                {if $item.duration}
                                <span><i class="fas fa-hourglass"></i> {$item.duration|formatDuration}</span>
                                {/if}
                            </div>
                            {if $item.duration && $item.progress}
                            <div class="history-progress">
                                <div class="history-progress-bar" style="width: {($item.progress/$item.duration)*100}%"></div>
                            </div>
                            {/if}
                        </div>
                        <div class="history-action">
                            <a href="{:url('player/index', ['url' => $item.video_url])}">继续观看</a>
                        </div>
                    </li>
                    {/foreach}
                </ul>
                {else}
                <div class="no-history">
                    <i class="fas fa-film" style="font-size: 48px; margin-bottom: 15px;"></i>
                    <p>暂无观看历史</p>
                </div>
                {/if}
            </div>
        </div>
    </div>
</body>
</html>